﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace NetFrameworkExtensions.DataLayer.EF4
{
  public abstract class ConcurrentDateTimeAuditableData<TIdentified, TIdentifier> :
    DateTimeAuditableData<TIdentified, TIdentifier>,
    IConcurrentData
    where TIdentified : ConcurrentDateTimeAuditableData<TIdentified, TIdentifier>
    where TIdentifier : IEquatable<TIdentifier>
  {
    [Timestamp]
    public byte[] Timestamp { get; set; }
  }

  public abstract class ConcurrentAuditableData<TIdentified, TIdentifier, TUserIdentifier> :
    AuditableData<TIdentified, TIdentifier, TUserIdentifier>,
    IConcurrentData
    where TIdentified : ConcurrentAuditableData<TIdentified, TIdentifier, TUserIdentifier>
    where TIdentifier : IEquatable<TIdentifier>
    where TUserIdentifier : struct, IEquatable<TUserIdentifier>
  {
    [Timestamp]
    public byte[] Timestamp { get; set; }
  }

  public abstract class IdentityConcurrentAuditableData<TIdentified, TIdentifier, TUserIdentifier> :
    IdentityAuditableData<TIdentified, TIdentifier, TUserIdentifier>,
    IConcurrentData
    where TIdentified : IdentityConcurrentAuditableData<TIdentified, TIdentifier, TUserIdentifier>
    where TIdentifier : IEquatable<TIdentifier>
    where TUserIdentifier : struct, IEquatable<TUserIdentifier>
  {
    [Timestamp]
    public byte[] Timestamp { get; set; }
  }
}
